<!DOCTYPE html>
<html style="min-height: 837px;"><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="UTF-8">
<title>工厂管理</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<!-- bootstrap 3.0.2 -->
<link href="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/bootstrap.css" rel="stylesheet" type="text/css">
<!-- font Awesome -->
<link href="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/font-awesome.css" rel="stylesheet" type="text/css">
<!-- Ionicons -->
<link href="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/ionicons.css" rel="stylesheet" type="text/css">
<!-- Theme style -->
<link href="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/AdminLTE.css" rel="stylesheet" type="text/css">

<link href="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/myself.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/pagination.css">
<script type="text/javascript" src="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/jquery.js"></script>
<!-- <script type="text/javascript" src="../js/jquery.pagination.js"></script> -->


<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
          <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
          <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
        <![endif]-->
<script type="text/javascript">
	        $(document).ready(function() {
	         	$("#Pagination").pagination("15");
	        });
		</script>
<style type="text/css">
.find-box .find-row .pull-left {
	padding: 0 1px;
}

.find-box-right {
	top: 0;
	right: 30px;
}

.style span {
	display: inline-block;
	border: 1px solid black;
	margin-right: 5px;
	margin-bottom: 5px;
	padding: 3px 6px;
	text-align: center;
}

.box-header {
	padding: 10px;
}

.modal-dialog {
	width: 300px;
}

.modal-title {
	font-size: 18px;
}

.modal-body {
	padding: 20px 20px 0;
	text-align: center;
}

.modal-body table {
	margin-left: 10px;
}
</style>
</head>
<body class="skin-blue  pace-done" style="min-height: 837px;"><div class="pace  pace-inactive"><div class="pace-progress" style="width: 100%;" data-progress-text="100%" data-progress="99">
  <div class="pace-progress-inner"></div>
</div>
<div class="pace-activity"></div></div>
	<!-- header logo: style can be found in header.less -->
	<!-- header logo: style can be found in header.less -->
<header class="header">
	<a href="http://139.224.191.23/index.html" class="logo"> <img src="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/logo_03.jpg"> 后台管理系统
	</a>
	<!-- Header Navbar: style can be found in header.less -->
	<nav class="navbar navbar-static-top" role="navigation">
		<div class="navbar-right">
			<ul class="nav navbar-nav">
				<!-- Notifications: style can be found in dropdown.less -->
				<li class="dropdown notifications-menu" style="margin:0;">
					<a href="#" class="dropdown-toggle" data-toggle="dropdown"> 
						<i class="iconfont"></i> 设置
					</a>
				</li>
				<!-- User Account: style can be found in dropdown.less -->
				<li class="dropdown user user-menu" style="margin:0;"><a href="#" class="dropdown-toggle" data-toggle="dropdown"> <i class="glyphicon glyphicon-user"></i> <span><span id="name2">3dfsafttttt</span> <i class="caret"></i></span>
				</a>
					<ul class="dropdown-menu" style="padding: 0">

						<!-- User image -->
						<li class="user-header bg-light-blue">
							<ul class="pull-left" style="border:none;">
								<li id="email">账号：admin</li>
								<li id="name">姓名：3dfsafttttt</li>
								<li id="roleName">角色：设计总监</li>
							</ul>
						</li>
						<!-- Menu Footer-->
						<li class="user-footer">
							<div class="pull-left" style="border:none;">
								<a href="#" class="btn btn-default btn-flat change_btn">修改密码</a>
							</div>
							<div class="pull-right">
								<a id="exit" href="#" class="btn btn-default btn-flat">退出</a>
							</div>
						</li>
					</ul></li>
			</ul>
		</div>
	</nav>
</header>
<!--修改密码弹框-->
<img class="masking" src="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/mask.jpg" style="display: none;">
<div class="change_pw" style="display: none;">
	<img id="close" class="pull-right change_delet" src="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/close.png">
	<form id="passwordform" action="">
		<div class="old_pw">
			<div class="input-group">
				<span class="input-group-addon new_add">原密码</span> <input id="oldPassword" name="oldPassword" class="form-control" placeholder="请输入原密码" type="password">
			</div>
		</div>
		<div class="new_pw">
			<div class="input-group">
				<span class="input-group-addon">设置新密码</span> <input id="newPassword1" name="newPassword" class="form-control" placeholder="请输入新密码" type="password">
			</div>
			<div>密码由6~8位字母（字母区分大小写）和数字组成</div>
		</div>
		<div class="beSure_pw">
			<div class="input-group">
				<span class="input-group-addon">确认新密码</span> <input id="newPassword2" class="form-control" placeholder="请输入密码" type="password">
			</div>
			<div id="notSame">两次密码不一致</div>
		</div>
	</form>
	<div class="pull-right sure">
		<a id="updatePassword" href="#" class="btn btn-primary">确定</a> <a id="delete" href="#" class="btn btn-default">取消</a>
	</div>
</div>

<style type="text/css">
.user-header ul {
	margin-top: 5px;
	margin-left: 5px;
	padding: 0;
}

.user-header ul li {
	color: rgba(255, 255, 255, 0.8);
	text-align: left;
	margin-top: 20px;
	font-size: 17px;
	list-style: none;
}

.masking {
	width: 100%;
	height: 100%;
	position: fixed;
	top: 0;
	left: 0;
	opacity: 0.3;
	z-index: 2;
}

.change_pw {
	width: 400px;
	height: 300px;
	background: white;
	position: fixed;
	top: 50%;
	left: 50%;
	margin-left: -200px;
	margin-top: -150px;
	z-index: 3;
	border: 1px solid #bbb;
}

.new_pw, .old_pw, .beSure_pw {
	margin-top: 20px;
	margin-left: 10px;
}

.old_pw {
	margin-top: 40px;
}

.new_pw div:nth-child(2) {
	font-size: 14px;
	margin-left: 20px;
	margin-top: 5px;
	color: red;
}

.beSure_pw div:nth-child(2) {
	display: none; font-size : 14px;
	margin-left: 20px;
	margin-top: 5px;
	color: red;
	font-size: 14px;
}

.old_pw div {
	margin-left: 25px;
}

.change_pw .input-group {
	width: 90%;
}

.change_pw .input-group:nth-child(1) {
	margin-left: 10px;
}

.new_add {
	padding: 6px 27px;
}

.sure {
	margin-right: 15px;
}

.sure a {
	margin: 20px 10px 0 0;
}

.change_delet {
	margin: 10px 10px 0 0;
}

#delete {
	cursor: pointer;
}
</style>

<script src="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/jquery.js" type="text/javascript"></script>

<script type="text/javascript">
	$('.masking').hide();
	$('.change_pw').hide();

	$('.change_btn').click(function() {
		$('.change_pw').show();
		$('.masking').show();
	});
	$('#delete').click(function() {
		$('.change_pw').hide();
		$('.masking').hide();
		$("#notSame").hide();
		$('#passwordform')[0].reset();
	});
	$('#close').click(function() {
		$('.change_pw').hide();
		$('.masking').hide();
		$("#notSame").hide();
		$('#passwordform')[0].reset();
	});
	$('#exit').click(function(){
		window.location.href="http://139.224.191.23/scm/logout";
	})
	$('#newPassword1').focus(function(){
		$("#notSame").hide();
	});
	$('#newPassword2').focus(function(){
		$("#notSame").hide();
	});
	$(function(){
		//向服务端获取当前用户基本信息
		var url="http://139.224.191.23/scm/sysuser/getUser";
		$.ajax({
			"url":url,
			"type":"get",
			"dataType":"json",
			"success":function(result){
				if(result.head.respCode=="0000000"){
					$('#name2').html(result.body.name);
					$('#email').html("账号："+result.body.email);
					$('#name').html("姓名："+result.body.name);
					var roleName="角色：";
					for(var i=0;i<result.body.roleName.length;i++){
						roleName+=result.body.roleName[i]+"、";
					}
					roleName=roleName.substring(0,roleName.length-1);
					$('#roleName').html(roleName);
				}
			},
			/* "error":function(result){
				if(result.head.respCode=="9999990"){
           		 	alert(result.body);
           		 }
			} */
		});
		//修改密码
		$('#updatePassword').click(function(){
			if($('#newPassword1').val()==""||$('#newPassword2').val()==""||$('#oldPassword').val()==""){
				alert("密码不能为空");
				return;
			}
			//两次密码不一致
			if($('#newPassword1').val()!=$('#newPassword2').val()){
				$("#notSame").show();
				return;
			}
			var formData = new FormData($('#passwordform')[0]);
			url="http://139.224.191.23/scm/sysuser/updatePassword";
			$.ajax({
				url: url,
				type: "post",
				data: formData,
				dataType: "json",
				async: false,  
	            cache: false,  
	            contentType: false,  
	            processData: false,
				success: function(result){
					if(result.head.respCode=="0000000"){
						alert(result.body);
						if(result.body=="密码修改成功"){
							window.location.href="http://139.224.191.23/scm/logout";
						}
						$('#passwordform')[0].reset();
					}
				},
				"error": function(result){
					if(result.head.respCode=="9999990"){
		           		 alert(result.body);
		           		$('#passwordform')[0].reset();
		           	}
				}
			});
		});
	})
</script>	<div class="wrapper row-offcanvas row-offcanvas-left" style="min-height: 713px;">
		<!-- Left side column. contains the logo and sidebar -->
<aside class="left-side sidebar-offcanvas" style="min-height: 837px;">
                <!-- sidebar: style can be found in sidebar.less -->
                <section class="sidebar">
                    <!-- sidebar menu: : style can be found in sidebar.less -->
                    <ul class="sidebar-menu">
                     <li class="active">
                            <a href="http://139.224.191.23/scm/factory/index">
                                <i class="fa fa-th"></i> <span>工作台</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                                                	 <li>
                            <a href="http://139.224.191.23/scm/designorder/list">
                                <i class="fa fa-th"></i> <span>设计订单</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/proofingorder/list">
                                <i class="fa fa-th"></i> <span>打样订单</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/productionorder/list">
                                <i class="fa fa-th"></i> <span>大货订单</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/hisgoryorder/list">
                                <i class="fa fa-th"></i> <span>历史订单</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/customer/list">
                                <i class="fa fa-th"></i> <span>客户管理</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/factory/list">
                                <i class="fa fa-th"></i> <span>工厂管理</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/designstore/list">
                                <i class="fa fa-th"></i> <span>设计库</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/sysuser/list">
                                <i class="fa fa-th"></i> <span>员工管理</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/operatelog/list">
                                <i class="fa fa-th"></i> <span>日志管理</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                        	 <li>
                            <a href="http://139.224.191.23/scm/sysrole/list">
                                <i class="fa fa-th"></i> <span>角色管理</span>
                                <i class="fa fa-angle-right pull-right"></i>
                            </a>
                        </li>
                    </ul>
                </section>
                <!-- /.sidebar -->
            </aside>
		<!-- Right side column. Contains the navbar and content of the page -->
		<aside class="right-side">
			<section class="content-header">
				<h1>工厂管理</h1>
				<!--修改 2016/12/01-->
        <div class="pull-right">
            <button style="position: absolute; top: 7px; right: 20px;" type="button" class="btn btn-primary" id="add_customer">新增工厂</button>
        </div>
        <!--修改-->
			</section>
			<section class="content">
				<div class="row">
					<div class="col-md-12">
						<div class="box">
							<div class="box-header find-box">
								<div class="pull-left find-row" style="width: 85%;">
									<form id="seach_factory" class="navbar-form navbar-left" action="../factory/list" method="get">
										<div class="pull-left find-col">
											<label class="pull-left"> <input id="factoryName" name="name" placeholder="输入工厂名" style="padding: 6px;" type="text">
											</label> <label class="pull-left"> <input id="linkman" name="linkman" placeholder="联系人" style="padding: 6px;" type="text">
											</label> <label class="pull-left"> <select id="cooperationCondition" name="cooperationCondition" class="input-md" style="padding:6px;"><option value="0" selected="selected">请选择合作条件</option><option value="20件以下">20件以下</option><option value="20~50件">20~50件</option><option value="50~100件">50~100件</option><option value="100~300件">100~300件</option><option value="300件以上">300件以上</option></select>
											</label> <label class="pull-left"> <select id="personAmount" name="personAmount" value="" class="input-md" style="padding:6px;"><option value="0" selected="selected">请选择工厂人数</option><option value="50人以下">50人以下</option><option value="50~100人">50~100人</option><option value="100~200人">100~200人</option><option value="200人以上">200人以上</option></select>
											</label> 
											<label class="pull-left"> 
											<input id="address" name="address" class="click" readonly="readonly" placeholder="地址" style="padding: 6px;" data-toggle="modal" data-target="#myModal" type="text">
												<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
													<div class="modal-dialog">
														<div class="modal-content">
															<div class="modal-header">
																<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
																<h4 class="modal-title" id="myModalLabel">选择地址</h4>
															</div>
															<div class="modal-body">
																<table>
																	<tbody><tr>
																		<td style="border: 0;">
																			<div class="form-group">
																				<select id="province" class="form-control sel1"><option value="0" selected="selected">请选择</option><option value="2">北京</option><option value="3">安徽</option><option value="4">福建</option><option value="5">甘肃</option><option value="6">广东</option><option value="7">广西</option><option value="8">贵州</option><option value="9">海南</option><option value="10">河北</option><option value="11">河南</option><option value="12">黑龙江</option><option value="13">湖北</option><option value="14">湖南</option><option value="15">吉林</option><option value="16">江苏</option><option value="17">江西</option><option value="18">辽宁</option><option value="19">内蒙古</option><option value="20">宁夏</option><option value="21">青海</option><option value="22">山东</option><option value="23">山西</option><option value="24">陕西</option><option value="25">上海</option><option value="26">四川</option><option value="27">天津</option><option value="28">西藏</option><option value="29">新疆</option><option value="30">云南</option><option value="31">浙江</option><option value="32">重庆</option><option value="33">香港</option><option value="34">澳门</option><option value="35">台湾</option></select>
																			</div>
																		</td>
																		<td style="border: 0;">
																			<div class="form-group">
																				<select id="city" class="form-control sel2">
																					<option value="0" selected="selected">请选择</option>
																				</select>
																			</div>
																		</td>
																		<td style="border: 0;">
																			<div class="form-group">
																				<select id="area" class="form-control sel3">
																					<option value="0" selected="selected">请选择</option>
																				</select>
																			</div>
																		</td>
																	</tr>
																</tbody></table>
															</div>
															<div class="modal-footer">
																<button type="button" class="btn btn-primary hid_click" data-dismiss="modal">
																	确定
																</button>
																<button type="button" class="btn btn-default hid_click" data-dismiss="modal">
																	取消
																</button>
															</div>
														</div>
														<!-- /.modal-content -->
													</div>
													<!-- /.modal -->
												</div>
											</label>
											<div class="pull-left" style="margin-left: 5px;">
												<button id="search" type="button" class="btn btn-primary">搜索</button>
											</div>
										</div>
									</form>
								</div>
							</div>
							<!-- /.box-header -->

							<div class="clearfix search-div center">
								<div class="clearfix"></div>
								<table class="table table-bordered text-center order-table">

									<tbody><tr>
										<th style="border: 0;" width="18%">基本信息</th>
										<th style="border: 0;" width="18%">梭织类型</th>
										<th style="border: 0;" width="18%">针织类型</th>
										<th style="border: 0;" width="18%">毛衣类型</th>
										<th style="border: 0;" width="10%">合作条件</th>
										<th style="border: 0;">操作</th>
									</tr>

								</tbody></table>
								<table class="table table-bordered order-list">
									<tbody><tr>
										<td class="left-text"><a href="http://139.224.191.23/scm/factory/showDetailPage?factoryId=57">
												工厂编号： <span class="number">20161129356027</span>
										</a></td>
									</tr>
									<tr>
										<td>
											<table width="100%">
												<tbody><tr>
													<td width="18%"><a href="http://139.224.191.23/scm/factory/showDetailPage?factoryId=57">
															<div style="margin: 0 0 15px 10px;">
																新建测试工厂</div>
													</a> 
														<div style="margin-left: 10px;">
															<i class="iconfont"></i>
															联系人：小胡
														</div>
														<div style="margin-left: 10px;">
															<i class="iconfont"></i>
															联系方式：11334453654
														</div> </td>
													<td class="style" width="18%"> <span>夹克</span>
 <span>裤子</span>
													</td>
													<td class="style" width="18%"> <span>连衣裙</span>
 <span>Polo衫</span>
 <span>T恤</span>
 <span>裤子</span>
 <span>外套</span>
													</td>
													<td class="style" width="18%"> <span>圆领</span>
 <span>外套</span>
													</td>
													<td class="text-center" width="10%">
														20件以下</td>
													<td class="text-center">
														<div>
															<a href="http://139.224.191.23/scm/factory/showModifyPage?factoryId=57">编辑</a>
														</div>
														<div>
															<a id="remove" href="http://139.224.191.23/scm/factory/deleteFactory?factoryId=57">删除</a>
														</div>
													</td>
												</tr>
											</tbody></table>
										</td>
									</tr>
								</tbody></table>
								<table class="table table-bordered order-list">
									<tbody><tr>
										<td class="left-text"><a href="http://139.224.191.23/scm/factory/showDetailPage?factoryId=50">
												工厂编号： <span class="number">20161124806714</span>
										</a></td>
									</tr>
									<tr>
										<td>
											<table width="100%">
												<tbody><tr>
													<td width="18%"><a href="http://139.224.191.23/scm/factory/showDetailPage?factoryId=50">
															<div style="margin: 0 0 15px 10px;">
																余杭制衣厂</div>
													</a> 
														<div style="margin-left: 10px;">
															<i class="iconfont"></i>
															联系人：小李
														</div>
														<div style="margin-left: 10px;">
															<i class="iconfont"></i>
															联系方式：143256546
														</div> </td>
													<td class="style" width="18%"> <span>夹克</span>
 <span>外套</span>
													</td>
													<td class="style" width="18%"> <span>西服</span>
 <span>裤子</span>
 <span>外套</span>
													</td>
													<td class="style" width="18%"> <span>圆领</span>
 <span>开衫</span>
													</td>
													<td class="text-center" width="10%">
														50~100件</td>
													<td class="text-center">
														<div>
															<a href="http://139.224.191.23/scm/factory/showModifyPage?factoryId=50">编辑</a>
														</div>
														<div>
															<a id="remove" href="http://139.224.191.23/scm/factory/deleteFactory?factoryId=50">删除</a>
														</div>
													</td>
												</tr>
											</tbody></table>
										</td>
									</tr>
								</tbody></table>
								<table class="table table-bordered order-list">
									<tbody><tr>
										<td class="left-text"><a href="http://139.224.191.23/scm/factory/showDetailPage?factoryId=56">
												工厂编号： <span class="number">20161128807914</span>
										</a></td>
									</tr>
									<tr>
										<td>
											<table width="100%">
												<tbody><tr>
													<td width="18%"><a href="http://139.224.191.23/scm/factory/showDetailPage?factoryId=56">
															<div style="margin: 0 0 15px 10px;">
																时尚秀服有限公司</div>
													</a> 
														<div style="margin-left: 10px;">
															<i class="iconfont"></i>
															联系人：小于
														</div>
														<div style="margin-left: 10px;">
															<i class="iconfont"></i>
															联系方式：11344223324
														</div> </td>
													<td class="style" width="18%"> <span>衬衣</span>
 <span>呢大衣</span>
 <span>羽绒服</span>
 <span>夹克</span>
													</td>
													<td class="style" width="18%"> <span>睡衣</span>
 <span>T恤</span>
 <span>连衣裙</span>
 <span>西服</span>
													</td>
													<td class="style" width="18%"> <span>连衣裙</span>
 <span>背心</span>
 <span>开衫</span>
 <span>V领</span>
													</td>
													<td class="text-center" width="10%">
														100~300件</td>
													<td class="text-center">
														<div>
															<a href="http://139.224.191.23/scm/factory/showModifyPage?factoryId=56">编辑</a>
														</div>
														<div>
															<a id="remove" href="http://139.224.191.23/scm/factory/deleteFactory?factoryId=56">删除</a>
														</div>
													</td>
												</tr>
											</tbody></table>
										</td>
									</tr>
								</tbody></table>


								<!-- <div class="pages fr">
							        <div id="Pagination"></div>
							        <div class="searchPage">
							          <span class="page-sum">共<strong class="allPage">15</strong>页</span>
							          <span class="page-go">跳至<input type="text" class="page-btn">页</span>
							          <a href="javascript:;" class="page-btn">跳转</a>
							        </div>
							    </div> -->
								<div class="box-footer clearfix">
									<ul class="pagination pagination-sm no-margin pull-right">
										 <li><a href="http://139.224.191.23/scm/factory/list?pageNo=1">首页</a></li><li><a href="#">上一页</a></li><li><a href="javascript:;" style="padding: 0;"><input value="1" style="border: none; border-bottom: 1px solid #ccc; padding: 4.5px 0; width: 40px;" type="text"></a></li><li><a href="#">下一页</a></li><li><a href="#">总1页</a></li><li><a href="#">尾页</a></li>
									</ul>
								</div>
							</div>
						</div>
					</div>
				</div>
			</section>
		</aside>
		<!-- /.right-side -->
	</div>
	<!-- ./wrapper -->

	<!-- jQuery 2.0.2 -->
	<script src="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/jquery.js"></script>
	<!-- jQuery UI 1.10.3 -->
	<script src="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/jquery-ui-1.js" type="text/javascript"></script>
	<!-- Bootstrap -->
	<script src="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/bootstrap.js" type="text/javascript"></script>
	<!-- AdminLTE App -->
	<script src="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/app.js" type="text/javascript"></script>
	<!-- AdminLTE for demo purposes -->
	<script src="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/demo.js" type="text/javascript"></script>


	<script type="text/javascript">
			$(function(){
				$('#addFactory').click(addFactory);
				//获取工人人数列表
				getPersonAmount();
				//获取合作条件列表
				getCooperationCondition()
				//获取所有省数据
	        	getAllProvince();
	        	$('#province').change(provinceOnSelect);
	        	$('#city').change(cityOnSelect);
				$('#search').click(function() {
					var factoryName = $('#factoryName').val();
					var linkman = $('#linkman').val();
					var cooperationCondition = $('#cooperationCondition').val();
					var personAmount = $('#personAmount').val();
					var address = $('#address').val();
					if (factoryName != null && factoryName != "") {
						$('#seach_factory').submit();
					}else if(linkman !=null && linkman!=""){
						$('#seach_factory').submit();
					}else if(cooperationCondition!=null&&cooperationCondition!=""){
						$('#seach_factory').submit();
					}else if(personAmount!=null&&personAmount!=""){
						$('#seach_factory').submit();
					}else if(address!=null&&address!=""){
						$('#seach_factory').submit();
					}
					else {
						$('#seach_factory').attr("action", "../factory/list");
						window.location.href = 'list';
					}
				});
			});
			
			$('.hid_click:eq(1)').click(function() {
				$('#seach_factory')[0].reset();
			});
			
			$('.hid_click:eq(0)').click(function() {
				var address=""
				if($("#province").find("option:selected").val()!=0){
					address+=$("#province").find("option:selected").text()+",";
				}
				if($("#city").find("option:selected").val()!=0){
					address+=$("#city").find("option:selected").text()+",";
				}
				if($("#area").find("option:selected").val()!=0){
					address+=$("#area").find("option:selected").text()+",";
				}
				address = address.substring(0,address.length-1);
				//var address = $("#province").find("option:selected").text()+$("#city").find("option:selected").text()+$("#area").find("option:selected").text()
				$('.click').val(address);
				$('.hid_address').hide();
				
			});
			
			
			function addFactory() {
				window.location.href = 'showAddPage';
			}
			
			//获取工厂人数列表
	        function getPersonAmount(){
	        	var constants = getConstant("scm_factory-person_amount");
	        	var view = $('#personAmount');
	        	view.empty();
	        	var option = $('<option value="0">请选择工厂人数</option>')
	        	view.append(option);
	        	for(var i=0;i<constants.length;i++){
	        		option = $('<option value="'+constants[i].name+'">'+constants[i].name+'</option>');
	        		view.append(option);
	        	}
	        }
			
	      //获取合作条件
	        function getCooperationCondition(){
	        	var constants = getConstant("scm_factory-cooperation_condition");
	        	var view = $('#cooperationCondition');
	        	view.empty();
	        	var option = $('<option value="0">请选择合作条件</option>')
	        	view.append(option);
	        	for(var i=0;i<constants.length;i++){
	        		option = $('<option value="'+constants[i].name+'">'+constants[i].name+'</option>');
	        		view.append(option);
	        	}
	        }
	      
	        //根据分类条件查询所有的常量列表
	        function getConstant(category){
	        	var constants={};
	        	var url = "../constant/getConstantByCategory";
	        	var data = {"category":category};
	        	//关闭ajax异步
	        	$.ajaxSettings.async = false;
	        	$.getJSON(url,data,function(result){
	        		if(result.head.respCode="0000000"){
	        			constants = result.body.rows;
	        		}
	        	});
	        	//开启ajax异步
	        	$.ajaxSettings.async = true;
	        	return constants;
	        }
	        
	      //获取所有省数据
	        function getAllProvince(){
	        	var url = "../area/province";
	        	$.getJSON(url,function(result){
	        		if(result.head.respCode=="0000000"){
	        			var provinces = result.body.rows;
	        			var view = $('#province');
	        			view.empty();
	        			var option = $('<option value="0">请选择</option>');
	        			view.append(option)
	        			for(var i=0;i<provinces.length;i++){
	        				var option = $('<option value="'+provinces[i].areaId+'">'+provinces[i].areaName+'</option>');
	        				view.append(option);
	        			}
	        		}
	        	});
	        }
	        
	      //从服务端根据parentId获取对应的市列表
	        function getCityByParentId(parentId){
	        	//console.log(parentId);
	        	var url = "../area/cityOrArea";
	        	var data = {"parentId":parentId};
	        	$.getJSON(url,data,function(result){
	        		if(result.head.respCode=="0000000"){
	        			var citys = result.body.rows;
	        			var view = $('#city');
	        			view.empty();
	        			var option = $('<option value="0">请选择</option>');
	        			view.append(option)
	        			for(var i=0;i<citys.length;i++){
	        				var option = $('<option value="'+citys[i].areaId+'">'+citys[i].areaName+'</option>');
	        				view.append(option);
	        			}
	        		}
	        	});
	        }

	        //从服务端根据parentId获取对应的区县列表
	        function getAreaByParentId(parentId){
	        	//console.log(parentId);
	        	var url = "../area/cityOrArea";
	        	var data = {"parentId":parentId};
	        	$.getJSON(url,data,function(result){
	        		if(result.head.respCode=="0000000"){
	        			var areas = result.body.rows;
	        			var view = $('#area');
	        			view.empty();
	        			var option = $('<option value="0">请选择</option>');
	        			view.append(option)
	        			for(var i=0;i<areas.length;i++){
	        				var option = $('<option value="'+areas[i].areaId+'">'+areas[i].areaName+'</option>');
	        				view.append(option);
	        			}
	        		}
	        	});
	        }
	        
	      //省下拉框选中监听事件
	        function provinceOnSelect(){
	        	if($(this).val()!="0"){
	        		//console.log($(this).val());
	        		//省选中后清空所有
	        		cleanArea();
	        		var provinceId = $(this).val();
	        		//从服务端获取对应的城市列表
	        		getCityByParentId(provinceId);
	        	}
	        	if($(this).val()=="0"){
	        		cleanCity();
	        		cleanArea();
	        	}
	        }

	        //市下拉框选中监听事件
	        function cityOnSelect(){
	        	if($(this).val()!="0"){
	        		var cityId = $(this).val();
	        		//从服务端获取对应的区县列表
	        		getAreaByParentId(cityId);
	        	}
	        	if($(this).val()=="0"){
	        		cleanArea();
	        	}
	        }


	        //清空市
	        function cleanCity(){
	        	var view = $('#city');
	        	view.empty();
	        	var option = $('<option value="0">请选择</option>');
	        	view.append(option);
	        }

	        //清空区县
	        function cleanArea(){
	        	var view = $('#area');
	        	view.empty();
	        	var option = $('<option value="0">请选择</option>');
	        	view.append(option);
	        }
			
		</script>



<script src="%E5%B7%A5%E5%8E%82%E7%AE%A1%E7%90%86_files/t.js" charset="utf-8"></script><div style="position: fixed; top: 150px; right: 0px; background: rgba(0, 0, 0, 0.7) none repeat scroll 0% 0%; border-radius: 5px 0px 0px 5px; padding: 10px 15px; font-size: 16px; z-index: 999999; cursor: pointer; color: rgb(221, 221, 221);" class="no-print"><i class="fa fa-gear"></i></div><div style="padding: 10px; position: fixed; top: 130px; right: -200px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 3px solid rgba(0, 0, 0, 0.7); width: 200px; z-index: 999999;" class="no-print"><h4 style="margin: 0 0 5px 0; border-bottom: 1px dashed #ddd; padding-bottom: 3px;">Layout Options</h4><div class="form-group no-margin"><div class=".checkbox"><label><input onchange="change_layout();" type="checkbox"> Fixed layout</label></div></div><h4 style="margin: 0 0 5px 0; border-bottom: 1px dashed #ddd; padding-bottom: 3px;">Skins</h4><div class="form-group no-margin"><div class=".radio"><label><input name="skins" onchange='change_skin("skin-black");' type="radio"> Black</label></div></div><div class="form-group no-margin"><div class=".radio"><label><input name="skins" onchange='change_skin("skin-blue");' checked="checked" type="radio"> Blue</label></div></div></div></body></html>